package com.example.tliasfight.mapper;

import com.example.tliasfight.pojo.Character;
import com.example.tliasfight.pojo.Emp;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {

//    @Select("select count(*)from emp")
//    Long count();
//    @Select("select * from emp limit #{start},#{pageSize}")
//   List<Emp> pageSelect(@Param(value = "start")Integer start, @Param(value = "pageSize")Integer pageSize);

 //   @Select("select *from emp where name like concat('%',#{name},'%') and gender = #{gender} and entrydate>=#{start}<=#{end}")
    public List<Emp> Page(@Param("name") String name, @Param("gender")Short gender, @Param("start")LocalDate start, @Param("end")LocalDate end);
    public void delete(@Param("ids") List<Integer> ids);
    public void insert(Emp emp);

    @Select("select * from emp where id = #{id}")
    public Emp selectById(@Param("id") Integer id);
 //   @Update("update emp set image=#{image},username=#{username},name=#{name},gender=#{gender},job=#{job},entrydate=#{entrydate},dept_id=#{deptId},update_time=now() where id=#{id}")
    public void update(Emp emp);
    @Delete("delete from emp where dept_id=#{deptId}")
    void deleteByDeptId(Integer deptId);

//    void Page2(Character character, @Param("startIndex")Integer startIndex);
//        @Select("select count(*)from emp")
//         Long count();
}
